package myky.com.doctorapp.model

import com.xiangyao.train.utils.RxScedulerHelper
import io.reactivex.Observable
import myky.com.doctorapp.api.ApiManager
import myky.com.doctorapp.entity.DiseaseEntity
import myky.com.doctorapp.base.BaseEntity
import myky.com.doctorapp.contract.ListActivityContract
import myky.com.doctorapp.utils.Constants
import myky.com.doctorapp.utils.RequestBodyBuilder

/**
 * Description:
 *
 * @author wuyangwuyang
 * Created by 2019/2/14 on 15:50
 */
class ListActivityModel : ListActivityContract.Model{


    override fun getDiseaseList(selectid:Int,current:Int,type:Int,size:Int): Observable<BaseEntity<DiseaseEntity.DataBean>> {

        val requestBodyBuilder= RequestBodyBuilder.Builder()
        requestBodyBuilder.params("version",Constants.CURRENTVERSION)
        requestBodyBuilder.params("selectid",selectid.toString())
        requestBodyBuilder.params("current",current.toString())
        requestBodyBuilder.params("selecttype",type.toString())
        requestBodyBuilder.params("size",size.toString())
        val requestBody = requestBodyBuilder.build()

        return ApiManager.getApistore().diseaseList(requestBody).compose(RxScedulerHelper.io_main())

    }


}
